package com.qa.dom.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.qa.dom.dto.HomePageDto;
import com.qa.dom.entity.Param;
import com.qa.dom.entity.Userguide;
import com.qa.dom.entity.Usertable;
import com.qa.dom.service.IUserguideService;
import com.qa.dom.service.IUsertableService;
import com.qa.dom.util.JsonResult;
import com.qa.dom.util.baseAction;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户指南
 * @author jiujichina
 * @since 2017-12-25
 */
@Controller
@Api(description = "用户指南控制器",tags = {"户指南"}, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping("/userguide")
    public class UserGuideController extends baseAction {
        @Resource
        private IUserguideService userguideService;

    /**
     * 获取用户指南（猜你想问,常见问题）
     * @param para
     * @return
     */
    @RequestMapping("/queryUserguide")
    @ResponseBody
    @ApiOperation(value = "问题",notes = "常见问题",httpMethod = "GET")
    public JsonResult queryParam(@ApiParam("问题")@RequestParam("para") String para){
        EntityWrapper<Userguide> paras= new EntityWrapper<>();
        //类型
        paras.eq("type",para);
        List<Userguide> list1= userguideService.selectList(paras);
        return renderSuccess(1,"请求成功",list1.size(),list1);
    }
}





